<?php 

namespace Admin\Controller;
use Admin\Controller\CommonController;

class AskCategoryController extends CommonController
{
	public function index()
	{
		// 问题分类
		$cats=D('AskCategory')->getTreeData('tree','order_number desc,id');		
		$this->assign("data", $cats);
		$this->display();
	}

	public function add()
	{
		// 问题分类
		$cats=D('AskCategory')->getTreeData('tree','order_number desc,id');	
		$this->assign("cats", $cats);
		$this->display();
	}

	public function doAdd()
	{
		$data = I("post.");
		$res = D('AskCategory')->addData($data);
		if ($res) {
			return show(1, "添加成功");
		}
		return show(0, "添加失败");
	}

	public function edit()
	{

	}

	public function doEdit()
	{

	}

	public function del()
	{
		
	}
}